package org.java.srb.core.service.impl;
import java.time.LocalDateTime;

import org.java.srb.core.pojo.entity.UserInfo;
import org.java.srb.core.mapper.UserInfoMapper;
import org.java.srb.core.service.UserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 用户基本信息 服务实现类
 * </p>
 *
 * @author huxb
 * @since 2021-04-11
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

    @Resource
    private UserInfoMapper userInfoMapper;

    @Override
    public void register(UserInfo userInfo) {
        UserInfo user = new UserInfo();

        user.setUserType(0);
        user.setMobile("");
        user.setPassword("");
        user.setNickName("");
        user.setName("");
        user.setIdCard("");
        user.setEmail("");
        user.setOpenid("");
        user.setHeadImg("");
        user.setBindStatus(0);
        user.setBorrowAuthStatus(0);
        user.setBindCode("");
        user.setIntegral(0);
        user.setStatus(0);
        user.setCreateTime(LocalDateTime.now());
        user.setUpdateTime(LocalDateTime.now());
        user.setDeleted(false);

        userInfoMapper.insert(user);
    }
}
